<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='收费详情',cssPaths='/static/css/financial/settlement/info.css',jsPaths='/static/plugins/qrcode.min.js,/static/plugins/jquery-migrate-1.2.1.min.js,/static/plugins/jquery.jqprint-0.3.js,/static/js/financial/settlementrecords/info.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                       <a href="/receipt">收费管理</a>
                        <a href="/settlementRecords">结算记录</a>
                        <a><cite>详情</cite></a>
                </span>
    </div>

    <div class="form-content">
        <div style="margin-top: 20px;">
            <a  href="javascript:void(0)"  class="layui-btn" id="dy">打印收据</a>
            <a  href="javascript:void(0)"  class="layui-btn" id="dy2">打印清单</a>
            <a href="/settlementRecords" class="layui-btn">返回</a>
        </div>
        <div id="print" style="padding-left: 5px;padding-right: 5px;padding-top: 20px;">
            <table class="mt">
                <tr>
                    <td colspan="3" style="text-align: center;border:0;">
                        <span th:text="${session.organization.name}+'收据'" style="width: 19cm;text-align: center;font-size: 16px;font-weight: bolder;letter-spacing: 5px;"></span>
                    </td>
                </tr>
                <tr>
                    <td style="border: 0" colspan="3" >
                        <span style="display: inline-block;width: 6cm;" th:text="'机构名称:&nbsp;&nbsp;'+${session.organization.name}" colspan="2"></span>
                        <span style="display: inline-block;width: 7cm;" th:text="'身份证号:&nbsp;&nbsp;'+${settlementRecords.elderlyIdNo}"></span>
                        <span th:text="'姓名:&nbsp;&nbsp;'+${settlementRecords.elderlyName}"></span>
                    </td>
                </tr>
                <tr>
                    <td style="width: 2cm;text-align: center;">收费类型</td>
                    <td style="width: 3cm;text-align: center;">金额</td>
                    <td style="width: 14cm;text-align: center;">明细</td>
                </tr>
                <tr>
                    <td style="text-align: center;" th:text="套餐收费"></td>
                    <td style="text-align: right;" th:text="'￥' + ${tcsfSum} + '&nbsp;'"></td>
                    <td style="text-align: center;" >
                            <span th:if="${tcsfSum} <= 0">无</span>
                            <span class="value" th:each="e,i: ${tcsf}">
                                 <span th:text="${e.key}+ ' x '+${e.value}"></span>
                                 <span th:if="${i.count != i.size}">,</span>
                             </span>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: center;" th:text="服务收费"></td>
                    <td style="text-align: right;" th:text="'￥' + ${fwsfSum} + '&nbsp;'"></td>
                    <td style="text-align: center;" >
                             <span th:if="${fwsfSum} <= 0">无</span>
                             <span class="value" th:each="e,i: ${fwsf}">
                                 <span th:text="${e.key}+ 'x'+${e.value}"></span>
                                     <span th:if="${i.count != i.size}">,</span>
                             </span>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: center;" th:text="其它收费"></td>
                    <td style="text-align: right;" th:text="'￥' + ${qtsfSum} + '&nbsp;'"></td>
                    <td style="text-align: center;" >
                        <span th:if="${qtsfSum} <= 0">无</span>
                             <span class="value" th:each="e,i : ${qtsf}">
                                 <span th:text="${e.key}+ 'x'+${e.value}"></span>
                                 <span th:if="${i.count != i.size}">,</span>
                             </span>
                    </td>
                </tr>
                <tr>
                    <td  style="text-align: center;">总计</td>
                    <td style="text-align: right;" th:text="'￥' + ${settlementRecords.settleAmount}+ '&nbsp;'"></td>
                    <td style="text-align: center;border-right: 0;" >
                        <span>大写:</span>
                        <span th:text=" ${dxSettleAmount}" ></span>
                    </td>
                    <td style="border-left: 0;">

                    </td>
                </tr>
                <tr>
                    <td style="border: 0;" colspan="3" >
                        <span style="display: inline-block;width: 6cm;" th:text="'收款日期:'+${#dates.format(settlementRecords.settleTime,'yyyy-MM-dd')}"></span>
                        <span style="display: inline-block;width: 7cm;">付款人:</span>
                        <span>收款人: <span th:text="${settlementRecords.toll}"></span></span>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div id="print2" style="padding-left: 5px;padding-right: 5px;padding-top: 20px;">
            <table class="mt2">
                <tr>
                    <td colspan="4" style="text-align: center;border:0;">
                        <span style="width: 19cm;text-align: center;font-size: 16px;font-weight: bolder;letter-spacing: 5px;">收费项目清单</span>
                    </td>
                </tr>
                <tr>
                    <td style="border: 0;text-align: left;" colspan="4">
                        <span style="display: inline-block;width: 6cm;" th:text="'机构名称:&nbsp;&nbsp;'+${session.organization.name}" colspan="2"></span>
                        <span style="display: inline-block;width: 7cm;" th:text="'身份证号:&nbsp;&nbsp;'+${settlementRecords.elderlyIdNo}"></span>
                        <span th:text="'姓名:&nbsp;&nbsp;'+${settlementRecords.elderlyName}"></span>
                    </td>
                </tr>
                <tr>
                    <td style="width: 2cm;text-align: center;">收费类型</td>
                    <td style="width: 3cm;text-align: center;">金额</td>
                    <td style="width: 7cm;text-align: center;">收费项目</td>
                    <td style="width: 7cm;text-align: center;">时间</td>
                </tr>
                <tr th:each="r:${receipts}">
                    <td th:if="${r.type}==1" th:text="服务收费"></td>
                    <td th:if="${r.type}==2" th:text="套餐收费"></td>
                    <td th:if="${r.type}==3" th:text="其它收费"></td>
                    <td th:text="'￥' + ${r.amount}"></td>
                    <td th:text="${r.name}">
                        <span th:if="${r.type eq 1}" th:text="${r.name}"></span>
                        <span th:if="${r.type} > 1" th:each="ri,i:${r.receiptItemsList}">
                            <span th:text="${ri.name}"></span>
                            <span th:if="${i.count != i.size}">,</span>
                        </span>
                    </td>
                    <td th:text="${#dates.format(r.createdTime, 'yyyy-MM-dd')}"></td>
                </tr>
                <tr>
                    <td  style="text-align: center;">总计</td>
                    <td style="text-align: right;" th:text="'￥' + ${settlementRecords.settleAmount}+ '&nbsp;'"></td>
                    <td style="text-align: center;border-right: 0;" >
                        <span>大写:</span>
                        <span th:text=" ${dxSettleAmount}" ></span>
                    </td>
                    <td style="border-left: 0;">

                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

</div>
</html>